package com.qf.day3;

import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入: ");
        int num = scanner.nextInt();
        int result = 0;
        while (num>0){
            result+=num%10;
            num/=10;
        }
        System.out.println(result);
    }
}
